package cn.tedu._06article.base.config;


import cn.tedu._06article.base.interceptors.UserLoginInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Slf4j
public class InterceptorConfig implements WebMvcConfigurer {
    public void addInterceptors(InterceptorRegistry registry) {
        log.debug("开始注册拦截器...");
        registry.addInterceptor(new UserLoginInterceptor())
                .addPathPatterns("/v1/**")
                .excludePathPatterns("/v1/user/login")
                .excludePathPatterns("/v1/user/selectByArticle");
    }
}
